package cn.itcast.controller;

import cn.itcast.pojo.*;
import cn.itcast.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private EmpService empService;

    @PostMapping
    public Result login(@RequestBody Emp emp){
        LoginVO login = empService.login(emp);

        return login != null ? Result.success(login) : Result.erro("登录失败");
    }
}
